<div id="statistical">
	<div class="nav">
		<a href="#admin/orders?type=全部"><div class="nav-li {{TypeNum==3&&'focus'}}" data='3'>所有订单</div></a>
		<a href="#admin/orders?type=未付款"><div class="nav-li {{TypeNum==1&&'focus'}}" data='1'>等待付款</div></a>
		<a href="#admin/orders?type=未发货"><div class="nav-li {{TypeNum==2&&'focus'}}" data='2'>等待发货</div></a>
		<div class="nav-li focus" data='4'>交易统计</div>
	</div>
	<div class="box">
		<hr>
		<div class="hr-bottom">
			<span>开始日期：<android:datePicker value="{{$Cahce.bus.statistical.info.from}}" bind-input="{{'$Cahce.bus.statistical.info.from'}}" max="{{$Cahce.bus.statistical.info.to}}" event-change="{{'$Event.bus.statistical.get_statistical_data'}}"></android:datePicker></span>
			<span>截止日期：<android:datePicker value="{{$Cahce.bus.statistical.info.to}}" bind-input="{{'$Cahce.bus.statistical.info.to'}}" min="{{$Cahce.bus.statistical.info.from}}" event-change="{{'$Event.bus.statistical.get_statistical_data'}}"></android:datePicker></span>
			<span><android:paperbutton event-click="{{'$Event.bus.statistical.toggle_show_method'}}">{{$State.bus.statistical.show_chart?'显示表单':'显示统计图'}}</android:paperbutton></span>
		</div>
		<div class="hr-bottom">支付方式：
			<android:switch checked="{{$Cahce.bus.statistical.info.filter_by_pay_method}}" bind-input="{{'$Cahce.bus.statistical.info.filter_by_pay_method'}}" event-change="{{'$Event.bus.statistical.get_statistical_data'}}">{{$Cahce.bus.statistical.info.filter_by_pay_method?'自定义过滤':'所有'}}</android:switch>
			{{#if $Cahce.bus.statistical.info.filter_by_pay_method}}
			<one-hand-select class="pay_method-list" value="$JSON:{{window.JSON.stringify($Cahce.bus.statistical.info.filter_pay_method_list)}}" bind-input="{{'$Cahce.bus.statistical.info.filter_pay_method_list'}}" event-change="{{'$Event.bus.statistical.get_statistical_data'}}">
				{{#each $Cache.PAY_METHOD_array}}
				<option class="pay_method-item" title="{{key}}" value="{{value}}">{{key}}</option>
				{{/each}}
			</one-hand-select>
			<!-- {{#each $Cache.PAY_METHOD_array}}
			<label class="pay_method-item" for="PAY_METHOD-{{value}}"><input id="PAY_METHOD-{{value}}" type="checkbox"/>{{key}}</label>
			{{/each}} -->
			{{/if}}
		</div>
		<!-- <div class="hr-bottom">
			订单状态：
			<input type="radio" value="pay_end">
		</div> -->
		{{#if $State.bus.statistical.show_chart}}
		<iframe id="statistical-chart-frame" class="statistical-chart-frame" src="__dotnar_lib_base_url__/echarts.html?project_name={{window.encodeURIComponent($Cache.bus.statistical.chart_frame_project_name)}}" frameborder="0"></iframe>
		{{#else}}
		<table class="paper-table">
			<thead>
				<td>日期</td>
				<td>订单量</td>
				<td>交易额度</td>
			</thead>
			{{#each $Cahce.bus.statistical.info.statis_info}}
			<tr>
				<td>{{#Time time,"YYYY-MM-DD"}}</td>
				<td>{{achs.length}}</td>
				<td>￥{{#Fixed total_cash}}</td>
			</tr>
			{{/each}}
			<tr>
				<td colspan="3">
					<i>{{$Cahce.bus.statistical.info?($Cahce.bus.statistical.info.statis_info.length?'':'暂无数据'):'加载中……'}}</i>
				</td>
			</tr>
		</table>
		{{/if}}
	</div>
</div>
<style>
	.pay_method-list{
		height: 1.6em;
	    overflow: hidden;
		vertical-align: text-top;
		border-color: #1ba1e2;
		padding: 0.1em;
		border-radius: 2px;
	}
	.pay_method-item{
		padding: 0 0.25em;
		display: inline-block;
		cursor: pointer;
	}
	.pay_method-item:checked:before{
		content:attr(title);
		position: absolute;
		background-color:#1ba1e2;
		color: white; 
		padding: 0 4px;
		margin-left: -4px;
	}
	.statistical-chart-frame{
		height: 400px;
		width: 100%;
	}
	.paper-table td{
		text-align: center;
	}
</style>